Skip to content

Conversation

@cappyzawa
Copy link
Member

@cappyzawa cappyzawa commented Jun 24, 2025

Implement fluxcd/flux2#5411 (comment) as part of GA preparation work.

This PR addresses two breaking changes for ImageUpdateAutomation API GA preparation:

  1. Template field .Updated removal (commit d35a65c): The .Updated template field has been deprecated and removed. Users should migrate to .Changed instead.

  2. Template field .Changed.ImageResult removal (commit 9176026): As part of Result/ResultV2 type consolidation, the .Changed.ImageResult template field has been removed. Users should migrate to:

    • .Changed.FileChanges for detailed change tracking
    • .Changed.Objects for object-level changes
    • .Changed.Changes for a flat list of changes

Both changes include appropriate error handling with migration guidance when deprecated fields are used in templates.

Copy link
Member

@matheuscscp matheuscscp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stefanprodan The field .Changed.ImageResult, whose type is the same of .Updated, is not documented: https://fluxcd.io/flux/components/image/imageupdateautomations/#message-template

Is this a mistake we need to fix in this PR, or is this intentional? Should .Changed.ImageResult also be removed?

Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks @cappyzawa 🏅

@cappyzawa cappyzawa force-pushed the deprecate-updated-template-field branch from 887803c to d35a65c Compare June 25, 2025 18:06
@cappyzawa
Copy link
Member Author

I squashed the commits after receiving approval.

@matheuscscp
Copy link
Member

Let's wait for Stefan to comment on the question above, IMO we need to either document or remove it as well. Probably document.

@stefanprodan
Copy link
Member

Should .Changed.ImageResult also be removed?

Yes, also the Result type should be deleted and Resultv2 renamed to Result. Basically we need to get rid of all the old code which is in lots of places.

@matheuscscp
Copy link
Member

@cappyzawa Can you please address this in this PR?

@cappyzawa cappyzawa force-pushed the deprecate-updated-template-field branch from 6b9552f to 13cb7a4 Compare June 28, 2025 16:37
Copy link
Member

@matheuscscp matheuscscp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀

Thanks very much once again @cappyzawa, please rebase and squash so we can merge

@cappyzawa cappyzawa force-pushed the deprecate-updated-template-field branch from 13cb7a4 to dd2861d Compare June 29, 2025 22:56
@matheuscscp
Copy link
Member

Sorry can you please rebase once more? I merged your other PR first 😅

Implement error handling for deprecated .Updated template field usage
in ImageUpdateAutomation commit message templates. When users attempt
to use deprecated .Updated fields, the controller now sets a Stalled
condition with a clear error message directing them to use .Changed
fields instead, preventing infinite reconciliation loops.

This prepares for the eventual removal of the .Updated field from the
ImageUpdateAutomation API as part of GA preparation.

Signed-off-by: cappyzawa <[email protected]>
Remove old Result type and rename ResultV2 to Result, following
Stefan's review feedback to eliminate complex nested structures.
This creates a single, flat Result type containing only FileChanges
for improved API simplicity.

Breaking changes:
- .Changed.ImageResult.Files/.Images/.Objects no longer available
- Users must migrate to .Changed.FileChanges, .Changed.Objects,
  and .Changed.Changes

Enhanced error handling provides specific guidance for removed
template fields, setting Stalled condition with clear migration
instructions. Updated documentation includes removal notes and
migration examples.

Signed-off-by: cappyzawa <[email protected]>
@cappyzawa cappyzawa force-pushed the deprecate-updated-template-field branch from dd2861d to f1a92cb Compare June 30, 2025 13:16
@cappyzawa
Copy link
Member Author

@matheuscscp Done 🚀

@matheuscscp matheuscscp merged commit 458e033 into fluxcd:main Jun 30, 2025
7 checks passed
@cappyzawa cappyzawa deleted the deprecate-updated-template-field branch June 30, 2025 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants